Skip to main content

SpriteEffect Class

Description:

  A class for creating SpriteEffect objects.

__call

Type: Metamethod.

Description:

  A metamethod that allows you to create a new SpriteEffect object.

Signature:

metamethod __call: function(self: SpriteEffectClass, vertShader: string, fragShader: string): SpriteEffect

Parameters:

ParameterTypeDescription
vertShaderstringThe vertex shader file string.
fragShaderstringThe fragment shader file string.
A shader file string must be one of the formats:
builtin: + theBuiltinShaderName
shader_compiled_file.bin
Shader/shader_source_file.sc
Details:
1. "builtin:" + name loads an embedded built-in shader.
2. For .sc files, the given path is loaded as shader source and compiled immediately.
3. For .bin files, if the given path exists, it is loaded directly.
4. Otherwise the engine tries renderer_dir/filename.bin, where renderer_dir
depends on the active backend, such as dx11, metal, glsl, essl, or spirv.

Returns:

Return TypeDescription
SpriteEffectA new SpriteEffect object.

__call

Type: Metamethod.

Description:

  A metamethod for creating a new empty SpriteEffect object.

Signature:

metamethod __call: function(self: SpriteEffectClass): SpriteEffect

Returns:

Return TypeDescription
SpriteEffectA new SpriteEffect object.